import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Display;

public class FishingPlace extends Canvas{
	private PlayMenu playmenu;
	private Display display;
	private byte yselect, menuselect;
	private GameBoard gameboard;
	public FishingPlace(PlayMenu playmenu, Display display){
		this.playmenu = playmenu;
		this.display = display;
		yselect = 40;
		menuselect = 1;
		gameboard = new GameBoard(playmenu, display);
		setFullScreenMode(true);
	}
	public void paint(Graphics g){
		g.setColor(255, 255, 255);
		g.fillRect(0, 0, 128, 160);		
		g.setColor(50,130,0);
		g.fillRect(0, yselect - 2, 128, 15);
		g.setColor(0, 0, 0);
		//g.drawLine(64,0,64,160);
		if(Option.language == true){			
			g.drawString("Chon noi cau:", 32,15,0);
			g.drawString("Ao", 57,40,0);
			g.drawString("Ho", 57,55,0);
			g.drawString("Song", 50,70,0);
			g.drawString("Bien", 53,85,0);
			g.drawString("Tro ve", 95, 145, 0);
		}
		else{			
			g.drawString("Select fishing place", 48,15,0);
			g.drawString("Ao", 47,40,0);
			g.drawString("Lake", 40,55,0);
			g.drawString("Driver", 15,70,0);
			g.drawString("Sea", 35,85,0);
			g.drawString("Back", 103, 145, 0);
		}
	}
	protected void keyPressed(int keycode){
		if((keycode == 50)||(keycode == -1)){		
			yselect -= 15;
			menuselect --;
			if(yselect < 40){
				yselect = 85;
				menuselect = 4;
			}
		}
		//Xy ly hien thi khi nhan xuong trong main menu
		if((keycode == 56)||(keycode == -2)){
			yselect += 15;
			menuselect ++;
			if(yselect > 85){
				yselect = 40;
				menuselect = 1;
			}
		}
		if(keycode == -7)
			display.setCurrent(playmenu);
		if((keycode == 53)||(keycode == -5)){
			Option.fishingplace = menuselect;
			gameboard = new GameBoard(playmenu,display);			
			display.setCurrent(gameboard);
		}		
		repaint();
	}
}